package hcn.protocol.brandnew.feiyong.shoufei;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 门诊待支付信息查询-响应消息(成功) - ODS_04030003_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class GetUnpayedListResponse {

    /**
     * 待支付记录集合
     */
    @XmlElementWrapper(name = "Records")
    @XmlElement(name = "Record")
    private List<Record> records;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class DetailsItemList {

        /**
         * 费用项目类型
         */
        @XmlElement(name = "ItemType")
        private Short itemType;
        /**
         * 费用项目代码
         */
        @XmlElement(name = "CostId")
        private String costId;
        /**
         * 费用项目名称
         */
        @XmlElement(name = "CostName")
        private String costName;
        /**
         * 费用数量
         */
        @XmlElement(name = "CostNumber")
        private String costNumber;
        /**
         * 贴数
         */
        @XmlElement(name = "PiecesChineseMedicineAgentNumb")
        private Byte piecesChineseMedicineAgentNumb;
        /**
         * 数量单位
         */
        @XmlElement(name = "NumberUnit")
        private String numberUnit;
        /**
         * 费用单价
         */
        @XmlElement(name = "CostPrice")
        private String costPrice;
        /**
         * 总计金额
         */
        @XmlElement(name = "TotalCost")
        private String totalCost;
        /**
         * 规格
         */
        @XmlElement(name = "DrugSpecifications")
        private String drugSpecifications;
        /**
         * 备注信息
         */
        @XmlElement(name = "Remark")
        private String remark;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class CostItemList {

        @XmlElement(name = "RequestId")
        private String requestId;
        /**
         * 费用日期
         */
        @XmlElement(name = "CostDate")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date costDate;
        /**
         * 费用项目分类代码
         */
        @XmlElement(name = "CostItemId")
        private String costItemId;
        /**
         * 费用归并名称
         */
        @XmlElement(name = "CostItemName")
        private String costItemName;
        /**
         * 归并小计
         */
        @XmlElement(name = "CostItemCount")
        private String costItemCount;
        /**
         * 收费单据标识
         */
        @XmlElement(name = "FeeNo")
        private String feeNo;
        /**
         * 4系Phis抵用券核销的时候需要使用的
         */
        @XmlElement(name = "VoucherItemId")
        private String voucherItemId;
        /**
         * 类型代码
         */
        @XmlElement(name = "FeeTypeCode")
        @DictionaryMapping(id = "hcn.base.dictionary.HCN_feeType")
        private String feeTypeCode;
        /**
         * 类型名称
         */
        @XmlElement(name = "FeeTypeName")
        private String feeTypeName;
        /**
         * 药房编码
         */
        @XmlElement(name = "PharmacyId")
        private String pharmacyId;
        /**
         * 是否必选
         */
        @XmlElement(name = "Required")
        private Byte required;
        /**
         * 代煎标志
         */
        @XmlElement(name = "BoilSign")
        private Byte boilSign;
        /**
         * 备注信息
         */
        @XmlElement(name = "Remark")
        private String remark;
        /**
         * 费用明细集合
         */
        @XmlElementWrapper(name = "DetailsItemLists")
        @XmlElement(name = "DetailsItemList")
        private List<DetailsItemList> detailsItemLists;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class MedicalInformation {

        /**
         * 就诊日期时间
         */
        @XmlElement(name = "VisitDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date visitDateTime;
        /**
         * 科室代码
         */
        @XmlElement(name = "DeptCode")
        private String deptCode;
        /**
         * 科室名称
         */
        @XmlElement(name = "DeptName")
        private String deptName;
        /**
         * 操作医生编码
         */
        @XmlElement(name = "DoctorId")
        private String doctorId;
        /**
         * 操作医生姓名
         */
        @XmlElement(name = "DoctorName")
        private String doctorName;
        /**
         * 总计金额
         */
        @XmlElement(name = "TotalCost")
        private String totalCost;
        /**
         * 就诊流水号
         */
        @XmlElement(name = "VisitId")
        private String visitId;
        /**
         * 就诊备注
         */
        @XmlElement(name = "Remark")
        private String remark;
        /**
         * 费用归并信息集合
         */
        @XmlElementWrapper(name = "CostItemLists")
        @XmlElement(name = "CostItemList")
        private List<CostItemList> costItemLists;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Record {

        /**
         * 患者ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 诊疗卡类型
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 诊疗卡号
         */
        @XmlElement(name = "MedicalCardID")
        private String medicalCardID;
        /**
         * 就诊信息集合
         */
        @XmlElementWrapper(name = "MedicalInformations")
        @XmlElement(name = "MedicalInformation")
        private List<MedicalInformation> medicalInformations;
    }

}
